package com.aletto.general_store.data.model;

import org.web3j.abi.datatypes.Int;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

public class Goods implements Serializable {

    private static final long serialVersionUID = -2095916884810199532L;
    public static final String EXTRA_NAME = "GOODS";

    public static final int DIGITIZED = 1, NOT_DIGITIZED = 2;


    public String object_id;
    public String goods_id;
    public String      id; // 商品ID
    public String       name; // 标题
    public Integer      type; // 1为数字商品，2为实物
    public List<String> goods_img; // 图片
    private List<String> desc;
    public List<String> label; // 标签
    public String       original_price; // 原价
    public String       price; // 价格
    public int      sales; // 销量
    public int stock;
    public String wallet_address;
    public int is_like;
    public String shop_id;

    //    // 商品ID
//    private long goodsId;
//    // 店铺ID
//    private long goodsStoreId;
//    // 标题
//    private String title;
//    // 价格
//    private float price = 0;
//    // 价格单位
    private String priceUnit = "USDT";
//    // 原价
//    private float priceOrigin;
//    // 销量
//    private int soldNumber;


    public Goods() {
        // ...
    }

    public Goods(String title, float price, String priceUnit, float priceOrigin, int soldNumber) {
        this.name = title;
//        this.price = String.valueOf(price);
//        this.priceUnit = priceUnit;
//        this.original_price = String.valueOf(priceOrigin);
//        this.sales = soldNumber;
    }

    public List<String> getDesc() {
        return desc;
    }

    public void setDesc(List<String> desc) {
        this.desc = desc;
    }

    public String getObject_id() {
        return object_id;
    }

    public void setObject_id(String object_id) {
        this.object_id = object_id;
    }

    public String getGoods_id() {
        return goods_id;
    }

    public void setGoods_id(String goods_id) {
        this.goods_id = goods_id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public List<String> getGoods_img() {
        return goods_img;
    }

    public void setGoods_img(List<String> goods_img) {
        this.goods_img = goods_img;
    }

    public List<String> getLabel() {
        return label;
    }

    public void setLabel(List<String> label) {
        this.label = label;
    }



    public int getSales() {
        return sales;
    }

    public void setSales(int sales) {
        this.sales = sales;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public int getIs_like() {
        return is_like;
    }

    public void setIs_like(int is_like) {
        this.is_like = is_like;
    }

    public String getShop_id() {
        return shop_id;
    }

    public void setShop_id(String shop_id) {
        this.shop_id = shop_id;
    }

    public void setPriceUnit(String priceUnit) {
        this.priceUnit = priceUnit;
    }

    public String getTitle() {
        return name;
    }


    public String getOriginal_price() {
        return original_price;
    }

    public double getOriginalPriceNumber() {
        return original_price != null ? new BigDecimal(original_price).doubleValue() : 0;
    }

    public void setOriginal_price(String original_price) {
        this.original_price = original_price;
    }

    public String getPrice() {
        return price;
    }

    public double getPriceNumber(){
        return price != null ? new BigDecimal(price).doubleValue() : 0;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public int getSoldNumber() {

        return sales;
    }

    public String getPriceUnit() {
        return priceUnit;
    }

    public List<String> getGoodsImg() {
        return goods_img;
    }


}
